import 'package:json_annotation/json_annotation.dart';

import 'axis.dart';
import 'text_style.dart';

part 'parallel_axis.g.dart';

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class AreaSelectStyle {
  var width;
  var borderWidth;
  var borderColor;
  var color;
  var opacity;

  AreaSelectStyle(
      {this.width,
      this.borderWidth,
      this.borderColor,
      this.color,
      this.opacity});

  factory AreaSelectStyle.fromJson(Map<String, dynamic> json) =>
      _$AreaSelectStyleFromJson(json);

  Map<String, dynamic> toJson() => _$AreaSelectStyleToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class ParallelAxis {
  var id;
  var dim;
  var parallelIndex;
  var realtime;
  AreaSelectStyle? areaSelectStyle;
  var type;

  var name;
  var nameLocation;

  TextStyle? nameTextStyle;
  var nameGap;
  var nameRotate;
  var inverse;
  var boundaryGap; //be set to either true or false or ['20%', '20%']
  var min; //varber var Function
  var max; //varber var Function
  var scale;
  var splitNumber;
  var minInterval;
  var maxInterval;
  var interval;
  var logBase;
  var silent;
  var triggerEvent;
  AxisLine? axisLine;
  AxisTick? axisTick;
  MinorTick? minorTick;
  AxisLabel? axisLabel;
  List<AxisData>? data;

  ParallelAxis(
      {this.id,
      this.dim,
      this.parallelIndex,
      this.realtime,
      this.areaSelectStyle,
      this.type,
      this.name,
      this.nameLocation,
      this.nameTextStyle,
      this.nameGap,
      this.nameRotate,
      this.inverse,
      this.boundaryGap,
      this.min,
      this.max,
      this.scale,
      this.splitNumber,
      this.minInterval,
      this.maxInterval,
      this.interval,
      this.logBase,
      this.silent,
      this.triggerEvent,
      this.axisLine,
      this.axisTick,
      this.minorTick,
      this.axisLabel,
      this.data});

  factory ParallelAxis.fromJson(Map<String, dynamic> json) =>
      _$ParallelAxisFromJson(json);

  Map<String, dynamic> toJson() => _$ParallelAxisToJson(this);
}
